package org.example.movies.service.impl;


import org.example.movies.dao.FilmDao;
import org.example.movies.dao.impl.FilmDaoImpl;
import org.example.movies.pojo.TFilm;
import org.example.movies.service.DetailService;
import org.example.movies.utils.IndexData;

import java.util.List;

public class DetailServiceImpl implements DetailService {
    private FilmDao filmDao = new FilmDaoImpl();
    private IndexData indexData = new IndexData();

    @Override
    public TFilm getDetail(String id) {
        return  filmDao.selectFilmById(id);
    }

    @Override
    public IndexData getClassify(String id) {
        List<TFilm> list = filmDao.selectTFilm(id);
        indexData.setFilms(list);
        return indexData;
    }
}
